﻿using Acme.ConcreteMixDesign.Dtos;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.ObjectMapping;

namespace Acme.ConcreteMixDesign.Controllers
{
    [Route("api/Player")]
    internal class PlayerController : ConcreteMixDesignController , IPlayerAppService
    {
        private readonly IPlayerAppService _playerAppService;
        public PlayerController(IPlayerAppService playerAppService)
        {
            _playerAppService = playerAppService;
        }

        public Task<PlayerDto> GetLogin(LoginPlayerDto loginPlayerDto)
        {
            throw new NotImplementedException();
        }

        [HttpGet]
        [Route("login")]
        public async Task<ActionResult<PlayerDto>> Login([FromBody]LoginPlayerDto loginPlayerDto)
        {
            var p = await _playerAppService.GetLogin(loginPlayerDto);
            if (p != null)
            {
                return Ok(p);
            }
            return NotFound(); // 这里使用 NotFound 表示未找到资源
        }

    }
}
